package com.zmx.b2c.order.service;

import com.zmx.b2c.order.dto.B2COrderItemDto;
import com.zmx.b2c.order.entity.B2COrderItem;
import com.zmx.b2c.order.repository.B2COrderItemRepository;
import com.zmx.b2c.order.service.mapper.B2COrderItemMapper;
import com.zmx.common.common.service.BaseService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
@author zhaomxr
*/
@Service
public class B2COrderItemService extends BaseService<B2COrderItem, B2COrderItemDto, B2COrderItemRepository, B2COrderItemMapper> {

    /**
     * 取订单详情
     * @param orderId
     * @return
     */
    public List<B2COrderItemDto> findByOrderId(Long orderId) {
        List<B2COrderItem> b2COrderItems = repository.findByOrderId(orderId);
        return entityToDto(b2COrderItems);
    }
}